import axios from "../utils/http";
//焙烧日报表
export function DailyReport(params) {
  return axios({
    url: "/DayTotal/getDay",
    method: "get",
    params: params,
  });
}
export function DailyReports(params) {
  return axios({
    url: "/DayTotal/getDays",
    method: "get",
    params: params,
  });
}

//焙烧月报表
export function MonthReport(params) {
  return axios({
    url: "/DayTotal/getMonth",
    method: "get",
    params: params,
  });
}

export function MonthReports(params) {
  return axios({
    url: "/DayTotal/getMonths",
    method: "get",
    params: params,
  });
}

// 添加新库存
export function graphiteReportGet(params) {
  return axios({
    url: "/graphiteReport/get",
    method: "get",
    params: params,
  });
}
export function graphiteReportCreate(payload) {
  return axios({
    url: "/graphiteReport/create",
    method: "post",
    data: payload,
  });
}
export function graphiteReportUpdate(payload) {
  return axios({
    url: "/graphiteReport/update",
    method: "put",
    data: payload,
  });
}
// 石墨化2更新
export function graphiteReportUpdate2(payload) {
  return axios({
    url: "/graphiteReport/update?edition=2",
    method: "put",
    data: payload,
  });
}
export function graphiteReportDelete(_id) {
  return axios({
    url: "/graphiteReport/delete?_id=" + _id,
    method: "delete",
  });
}
export function graphiteReportDelete2(_id) {
  return axios({
    url: "/graphiteReport/delete?edition=2&_id=" + _id,
    method: "delete",
  });
}
export function graphiteReportExcelCreate(payload, params) {
  return axios({
    url: "/graphiteReport/excelCreate",
    method: "post",
    data: payload,
    params: params,
    headers: { "Content-Type": "multipart/form-data" },
  });
}
export function graphiteReportGetStartAndStopTime() {
  return axios({
    url: "/graphiteReport/getStartAndStopTime",
    method: "get",
  });
}
export function minioUpload(params, payload) {
  return axios({
    url: "/minio/upload",
    method: "post",
    data: payload,
    params: params,
  });
}
// 历史报表
export function getHisReport(payload) {
  return axios({
    url: "/graphitingData/getReportOut",
    method: "get",
    params: payload,
  });
}
export function getHisReportTest(payload) {
  return axios({
    url: "/graPowerReport/get",
    method: "get",
    params: payload,
  });
}

// 导出报表
export function getReportData(data) {
  return axios({
    url: "/graReport/getReportData",
    method: "get",
    params: data,
  });
}
export function getPowerReportData(data) {
  return axios({
    url: "/graPowerReport/getPower",
    method: "get",
    params: data,
  });
}

// 历史报表 装炉信息
export function getReportStoveData(data) {
  return axios({
    url: "/graphiteReport/get",
    method: "get",
    params: data,
  });
}
// 历史报表获取原始数据
export function getOriginalData(data) {
  return axios({
    url: "/graphitingData/getInitData",
    method: "get",
    params: data,
  });
}
export function getPressMoldOrders(data) {
  return axios({
    url: "/cruciblePressMold/get",
    method: "get",
    params: data,
  });
}

export function displacementData(params) {
  return axios({
    url: "/graphitingData/getDisplaceChange",
    method: "get",
    params: params,
  });
}
//石墨化3
//装炉单
export function updatedAvater(payload) {
  return axios({
    url: "/graReport/uploadCharge",
    method: "post",
    data: payload,
  });
}
//删除工单
export function graReportDelete(payload) {
  return axios({
    url: "/graReport/delete",
    method: "DELETE",
    params: payload,
  });
}
//数据中心/石墨化报表-创建工单
export function graReport(data) {
  return axios({
    url: "/graReport/create",
    method: "post",
    data: data,
  });
}
//数据中心 / 石墨化报表 - 更改工单;
export function graReportupdate(payload) {
  return axios({
    url: "/graReport/update",
    method: "PUT",
    data: payload,
  });
}

//数据中心/石墨化报表-删除附件
export function removeFile(payload) {
  return axios({
    url: "/graReport/removeFile",
    method: "DELETE",
    params: payload,
  });
}

//数据中心/石墨化报表-上传送电附件
export function uploadPower(payload) {
  return axios({
    url: "/graPowerReport/uploadPower",
    method: "POST",
    data: payload,
  });
}
//数据中心/石墨化报表-创建送电工单
export function createPower(payload) {
  return axios({
    url: "/graPowerReport/create",
    method: "POST",
    data: payload,
  });
}
//数据中心/石墨化报表-创建质检工单
export function createquality(payload) {
  return axios({
    url: "/graQualityReport/create",
    method: "POST",
    data: payload,
  });
}
//数据中心/石墨化报表-上传质检附件
export function uploadquality(payload) {
  return axios({
    url: "/graQualityReport/upload",
    method: "POST",
    data: payload,
  });
}
//数据中心/石墨化报表-获取报表数据Excel
export function ReportgetExcel(payload) {
  console.log(payload);
  return axios({
    url: "/graPowerReport/getExcel",
    method: "GET",
    params: payload,
  });
}
//数据中心/石墨化报表-获取报表电量具体数据与位移
export function ReportgetPower(payload) {
  console.log(payload);
  return axios({
    url: "/graPowerReport/getPower",
    method: "GET",
    params: payload,
  });
}
